/**
*
* author ThuanLT
* Aug 22, 2014
*
*/

package vn.fsoft.gst.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import vn.fsoft.gst.dao.OrganisationDAO;
import vn.fsoft.gst.domain.Organisation;

@Service
public class OrganisationServiceImpl implements OrganisationService{
	@Autowired
	private OrganisationDAO organisationDAO;
	@Transactional
	public int addOrganisation(Organisation org) {
		return organisationDAO.addOrganisation(org);
		
	}
	@Transactional
	public void updateOrganisation(Organisation org) {
		organisationDAO.updateOrganisation(org);
	}
	
	@Transactional
	public void deleteOrganisation(int orgID) {
		organisationDAO.deleteOrganisation(orgID);
	}
	
	@Transactional
	public List<Organisation> getListOrganisation() {
		//call dao layer to get list organisations
		return organisationDAO.getListOrganisation();
	}
	
	@Transactional
	public Organisation getOrganisationByID(int orgID) {
		return organisationDAO.getOrganisationByID(orgID);
	}
	@Transactional
	public void activeOrganisation(int orgID) {
		//call dao layer to active organisation with identify id
		organisationDAO.activeOrganisation(orgID);
	}

	@Transactional
	public List<Organisation> getListOrganisations() {
		return organisationDAO.getListOrganisation();
	}
	
	public int getOrganisationIDMax() {
		// TODO Auto-generated method stub
		return organisationDAO.getOrganisationIDMax();
	}
	@Transactional
	public void inActiveOrganisation(int orgID) {
		organisationDAO.inactiveOrganisation(orgID);
		
	}
}
